<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
    <script src="https://cdn.staticfile.org/vue/2.4.2/vue.min.js"></script>
</head>

<body>
    <div id="app">
        
        <Father></Father>
    </div>
    <template id="father">
        <div>
            <h1>这是父组件{{money}}</h1><br/>
            <Son v-bind:money='money'></Son>
        </div>
    </template>

    <template id="son">
        <div>
            <h1>这是子组件</h1><br/>
            {{money}}
        </div>
    </template>

    <script>
        Vue.component('Father',{
            template:'#father',
            data(){
                return {
                    money:'2000',
                }
            },
        })
        Vue.component('Son',{
            template:'#son',
            props:['money']

        })
        var vm=new Vue({
           el:'#app',

           data:{},
           methods:{}
        });
        //父子组件通信首先创建两个组件
        //然后在父组件里面嵌套子组件并用v-bind给子组件绑定一个属性然后在子组件中庸props接受，然后到在子组件里面去使用props的值
    </script>
</body>

</html>